package cn.ainit.sys.query;

import java.util.List;

import javax.activation.DataSource;

import cn.ainit.sys.ds.store.sysDataStore;
import cn.ainit.sys.query.datastore.DataStore;
import cn.ainit.sys.query.entity.QueryButton;
import cn.ainit.sys.query.entity.QueryColumn;
import cn.ainit.sys.ui.forms.Columns;

public interface DynamicQueryDao {

	/***
	 * 获取查询界面按钮
	 * @param partOrAll
	 * @return
	 * @throws Exception
	 */
	List<QueryButton> getQueryButtons(String partOrAll,String id) throws Exception;
	/***
	 * 获取查询界面字段
	 * @param partOrAll
	 * @return
	 * @throws Exception
	 */
	List<QueryColumn> getQueryColumns(String partOrAll,String id) throws Exception;
	/***
	 * 获取所有查询条件字段
	 * @param partOrAll
	 * @param formsId 
	 * @return
	 * @throws Exception
	 */
	List<Columns> getQueryUIColumns(String partOrAll, String formsId) throws Exception;
	/***
	 * 获取所有DATAGRID字段
	 * @param partOrAll
	 * @return
	 * @throws Exception
	 */
	List<QueryColumn> getQueryShowColumns(String flag,String id) throws Exception;
	/**
	 * 增加DS_SQL
	 * @param dataStore
	 * @return
	 * @throws Exception
	 */
	boolean adddataStore(sysDataStore dataStore) throws Exception;
	/**
	 * 根据ds_id查询sql语句
	 * @param id
	 * @return
	 * @throws Exception
	 */
	DataStore querySql(String id) throws Exception;
	/***
	 * 查询dataGrid数据
	 * @param sql
	 * @param pageNumber
	 * @param pageSize
	 * @return
	 * @throws Exception
	 */
	List getRows(String sql, int pageNumber, int pageSize) throws Exception;
}
